package com.example.springmall;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@SpringBootApplication
public class App {

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(App.class);
        Environment env = app.run(args).getEnvironment();
        
        log.info("\n----------------------------------------------------------\n" +
                "应用 '{}' 运行成功! 访问路径:\n" +
                "本地: \t\thttp://localhost:{}\n" +
                "外部: \t\thttp://192.168.3.254:{}\n" +
                "----------------------------------------------------------",
                env.getProperty("spring.application.name", "在线商城"),
                env.getProperty("server.port", "8080"),
                env.getProperty("server.port", "8080"));
    }

}
